package com.github.admin.edu.security.jwt.server.controller;

import com.github.admin.edu.oauth.server.api.service.ServiceOrganizationManagerServiceApi;
import com.github.admin.edu.security.jwt.server.service.impl.ServerOrganizationServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Create by IntelliJ IDEA
 * 用户：王建
 * 日期：2018-8-1
 */
@RestController
public class ServerOrganizationController implements ServiceOrganizationManagerServiceApi {

    @Autowired
    private ServerOrganizationServiceImpl service;

    @Override
    public String getEntity(Integer id) {
        return service.getEntity(id);
    }

    @Override
    public String saveOrUpdate(@RequestBody String jsonEntity) {

        return service.saveOrUpdate(jsonEntity);
    }

    @Override
    public String getAllByPager(String title, Integer current, Integer rows, String order, String fileId) {
        return service.getAllGetEntity(title,current,rows,order,fileId);
    }

    @Override
    public String getALLByPager(@RequestBody String jsonEntity) {
        return service.getALLPostByPager(jsonEntity);
    }

    @Override
    public String getAllEntity(String title, String order, String fileId) {
        return service.getAllEntity(title,order,fileId);
    }

    @Override
    public String getAllEntityByTree() {
        return service.getAllByTree();
    }

    @Override
    public String deleteAll(String ids) {
        return service.delete(ids);
    }

    @Override
    public String deleteByRootId(Integer id) {
        return service.deleteBYRootId(id);
    }

    @Override
    public String findOrgByFirst() {
        return service.findOrgByFirst();
    }
}
